/**
 * 资源最高价映射
 */
export type ResourceTopPrice = {
    [resourceType in MarketResourceConstant]?: number
}

/**
 * 房间内各资源订单
 */
export type RoomOrders = {
    [resourceType in MarketResourceConstant]?: Order[]
}

/**
 * 各房间订单
 */
export type AllRoomOrders = {
    [roomName: string]: RoomOrders
}

/**
 * 订单类型
 */
export type OrderType = ORDER_BUY | ORDER_SELL

/**
 * deal 选项
 */
export interface DealOpts {
    /**
     * 最低价格，deal 买单时，低于此价格就不卖
     */
    minPrice?: number
    /**
     * 最高价格，deal 卖单时，高于此价格就不买
     */
    maxPrice?: number
    /**
     * 范围，只在此范围内交易
     */
    range?: number
    /**
     * 最低交易量，低于此交易量的订单不考虑
     */
    minAmount?: number
}

declare global {
    interface Game {
        _allRoomOrders?: AllRoomOrders
    }

    interface Memory {
        market?: {
            /**
             * 需要自动加价的资源
             */
            autoRaiseTypes?: string[]
            /**
             * 每次加价的数量
             */
            addPrice?: number
        }
    }
}
